package raku.packet;

import java.io.Serializable;
public class Packet implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = -7535128346975856686L;
	public static final int LOGIN = 0;
	public static final int LOGIN_FAILE = -1;
	public static final int LOGIN_SUCCESS = 1;
	public static final int SHOOT = 2;
	public static final int FAKE = 3;
	public static final int RESTART = 4;
	public static final int MAKE_ROOM = 5;
	public static final int JOIN_ROOM = 6;
	public static final int QUIT_ROOM = 7;
	public static final int DISCONNECT = 8;
	public static final int REQUEST_ROOM_LIST = 9;
	public static final int LOSE = 10;
	public static final int WIN = 11;
	
	private int id;
	private int type;
	private int index;
	private String[] data;
	public Packet(int t){type = t;}
	public Packet(int t, String a){type = t; data = new String[]{a};}
	public Packet(int t, String a, String b){type = t; data = new String[]{a,b};}
	public Packet(int t, String a, String b, String c){type = t;data = new String[]{a,b,c};}
	public Packet(int t, String[]s){type = t;data = s;}
	public Packet(){};
	public int getType() {
		return type;
	}
	public void setType(int type) {
		this.type = type;
	}
	public String[] getData() {
		return data;
	}
	public void setData(String[] data) {
		this.data = data;
	}
	public int size(){
		return data.length;
	}
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public int getIndex() {
		return index;
	}
	public void setIndex(int index) {
		this.index = index;
	}
}
